package com.mykolaBlyk.graphexample;

import static org.junit.Assert.*;

public class Test {
	Equation eq= new Equation(1.0,12.0,5.0);
		
	@org.junit.Test
	public void testDerivative(){
		if(22!=eq.calculateDerivative(5)){
			fail("Not yet implemented");
		}
		if(2!=eq.calculateDerivative(-5)){
			fail("Not yet implemented");
		}
		if(13!=eq.calculateDerivative(0.5)){
			fail("Not yet implemented");
		}
		
	}
	@org.junit.Test
	public void testDiscriminant(){
		if(124!=eq.calculateDiscriminant()){
			fail("Not yet implemented");
		}
		
		eq=new Equation(3.0,10.0, -3.0);
		if(136!=eq.calculateDiscriminant()){
			fail("Not yet implemented");
		}
		
		eq=new Equation(1.5, 97.0,44.0);
		if(9145!=eq.calculateDiscriminant()){		
			fail("Not yet implemented");
		}
	}

	@org.junit.Test
	public void testCalculateFunction(){
		if(69!=eq.calculateFunction(4)){
			fail("Not yet implemented");
		}
		eq= new Equation(32.0,15.0,-9.0);
		
		if(6.5!=eq.calculateFunction(0.5)){
			fail("Not yet implemented");
		}
	}

	@org.junit.Test
	public void testCalculateExt(){
		
		eq= new Equation(2.0,4.0,1.0);
		MyPoint point= new MyPoint(-1.0,-1.0);
		
		if(!point.equals(eq.calculateExt())){
			System.out.println(eq.calculateExt().getX()+" "+eq.calculateExt().getY());
			fail("Not yet implemented");
		}
		
	}
}
